import Message from './Message';
import i18next from './i18next/i18n';
import { Code } from './Response';
const { t } = i18next;
const initErrorResponse = (code: string | number) => {
	switch (code) {
		case '1001':
			Message.warning(t('user-no-exist'));
			break;
		case '1103':
			Message.warning(t('relogin-wrong-user'));
			break;
		case '1104':
			Message.warning(t('relogin-invalid-account'));
			break;
		default:
			Message.warning(t('service-error'));
			break;
	}
};

const loginErrorResponse = (error: any) => {
	switch (error.code) {
		case '3008':
			Message.warning(t('send-login-failed'));
			break;
		case '3006':
			Message.warning(t('send-login-failed'));
			break;
		case '3009':
			Message.warning(t('reconnect-login-error'));
			break;
		case '1001':
			Message.warning('账号不存在');
			break;
		case '1103':
			Message.warning(`密码错误，今日还有${error?.message?.data?.data?.retryTimes}次机会`);
			break;
		case '1106':
			Message.warning('登录密码错误超过次数，无法登录，请次日再试。');
			break;
		case '1107':
			Message.warning(`您的密码属于初始密码，请重新设置`);
			break;
		case '1108':
			Message.warning(`您当前使用的登录密码已过期，请更新密码！`);
			break;
		default:
			Message.warning(t('login-failed'));
			break;
	}
};

const onDropErrorResponse = (code: string | number) => {
	switch (code) {
		case 403:
			Message.warning(t('relogin-other-login'));
			break;
		case 401:
			Message.warning(t('relogin-kickoff'));
			break;
		case 402:
			Message.warning(t('relogin-network-error'));
			break;
		case 404:
			Message.warning(t('relogin-network-broken'));
			break;
		case 405:
			Message.warning(t('relogin-network-reconnect'));
			break;
		default:
			break;
	}
};

const readyErrorResponse = (code: string | number) => {
	switch (code) {
		case '3006':
			Message.warning(t('send-ready-failed'));
			break;
		case '3007':
			Message.warning(t('reconnect-ready-error'));
			break;
		case '3009':
			Message.warning(t('reconnect-ready-error'));
			break;
		case '3008':
			Message.warning(t('send-ready-failed'));
			break;
		default:
			Message.warning(t('ready-failed'));
			break;
	}
};

const unReadyErrorResponse = (code: string | number) => {
	switch (code) {
		case '3006':
			Message.warning(t('send-unReady-failed'));
			break;
		case '3007':
			Message.warning(t('send-message-timeout'));
			break;
		case '3009':
			Message.warning(t('reconnect-unReady-error'));
			break;
		case '3008':
			Message.warning(t('send-unReady-failed'));
			break;
		default:
			Message.warning(t('cancel-ready-failed'));
			break;
	}
};

const appointErrorResponse = (code: string | number) => {
	switch (code) {
		case '3006':
			Message.warning(t('send-message-error'));
			break;
		case '3007':
			Message.warning(t('send-message-timeout'));
			break;
		case '3009':
			Message.warning(t('network-reconnecting'));
			break;
		default:
			Message.warning(t('break-book-failed'));
			break;
	}
};

const checkInErrorResponse = (code: string | number) => {
	switch (code) {
		case '3006':
			Message.warning(t('send-checkIn-failed'));
			break;
		case '3007':
			Message.warning(t('send-message-timeout'));
			break;
		case '3009':
			Message.warning(t('reconnect-checkIn-error'));
			break;
		case '3008':
			Message.warning(t('send-checkIn-failed'));
			break;
		default:
			Message.warning(t('check-in-group-failed'));
			break;
	}
};

const checkOutErrorResponse = (code: string | number) => {
	switch (code) {
		case '3006':
			Message.warning(t('send-checkOut-failed'));
			break;
		case '3007':
			Message.warning(t('send-message-timeout'));
			break;
		case '3009':
			Message.warning(t('reconnect-checkOut-error'));
			break;
		case '3008':
			Message.warning(t('send-checkOut-failed'));
			break;
		default:
			Message.warning(t('check-out-group-failed'));
			break;
	}
};

const answerErrorResponse = (code: string | number) => {
	switch (code) {
		case '60022':
			Message.warning(t('device-request-reject'));
			break;
		case '60023':
			Message.warning(t('device-start-failed'));
			break;
		case '60024':
			Message.warning(t('device-start-failed'));
			break;
		case '60025':
			Message.warning(t('device-resolution-not-match'));
			break;
		case '1017':
			Message.warning(t('client-leaved-error'));
			break;
		case '5008':
			Message.warning(t('session-end-error'));
			break;
		case '5006':
			Message.warning(t('answer-call-error'));
			break;
		case '106':
			Message.warning(t('answer-call-error'));
			break;
		default:
			Message.warning(t('answer-call-error'));
			break;
	}
};

const ccsErrorResponse = (code: string | number) => {
	switch (code) {
		case 103:
			Message.warning(t('network-broken-session-end'));
			break;
		case 105:
			Message.warning(t('network-fluctuation-retry-failed'));
			break;
		default:
			break;
	}
};

const ConnectStatusErrorResponse = (status: string) => {
	switch (status) {
		case 'connect':
			Message.normal(t('connect-success'));
			break;
		case 'reconnecting':
			Message.warning(t('network-try-to-recover'));
			break;
		case 'reconnect_failed':
			Message.warning(t('reconnect-failed'));
			break;
	}
};

const systemErrorResponse = (code: string | number, errorData: string) => {
	let customerSubscribeId = sessionStorage.getItem('customerSubscribeId');
	switch (code) {
		case 1006:
			Message.warning(t('relogin-network-error'));
			break;
		case 1007:
			Message.warning(t('network-message-error-whether-hangup'));
			break;
		case 1005:
			Message.warning(t('network-media-error-whether-hangup'));
			break;
		case 1004:
			if (errorData === customerSubscribeId) {
				Message.warning(t('client-video-disconnect'));
			}
			break;
		default:
			break;
	}
};

const transferErrorResponse = (error: any, type: string, options?: any) => {
	switch (error.code) {
		case '404':
			Message.warning(type === 'transfer' ? t('not-available-agent') : t('agent-unable-to-answer'));
			break;
		case '406':
			Message.warning(t('transfer-failed-not-work-day'));
			break;
		case '407':
			Message.warning(t('transfer-failed-not-work-time'));
			break;
		case '401':
			Message.warning(t('transfer-timeout-wait-retry'));
			break;
		case '408':
			Message.warning(t('business-scenarios-not-available'));
			break;
		case '402':
			switch (error.waitingCode) {
				case '1001':
					Message.warning(t('agent-not-available'));
					break;
				case '1002':
					Message.warning(t('agent-not-login'));
					break;
				case '1003':
					Message.warning(t('transfer-agent-not-available'));
					break;
				case '1004':
					Message.warning(t('transfer-agent-session-disconnect'));
					break;
				default:
					Message.warning(t('assigning-agents'));
					break;
			}
			break;
		case '412':
			if (type === 'transfer') {
				Message.warning(t('not-transfer-ai-agent-multiple-clients'));
			} else {
				Message.warning(t('not-invite-ai-agent-multiple-clients'));
			}
			break;
		case '413':
			if (type === 'transfer') {
				Message.warning(t('reject-join-session'));
			} else {
				Message.warning(t('not-invite'));
			}
			break;
		case '400':
			Message.warning(t('no-seats-available-transfer-error'));
			break;
		case '418':
			Message.warning(t('scenario-roles-notMatched'));
			break;
		case '601':
			Message.warning(t('audio-video-recording-completed'));
			break;
		case '602':
			Message.warning(t('audio-video-recording-waited'));
			break;
		case '603':
			Message.warning(t('audio-video-recordingIn-progress'));
			break;
		case '604':
			Message.warning(t('audio-video-rerecordingIn-progress'));
			break;
		case '605':
			if (type === 'transfer') {
				Message.warning(t('transfer-call-exists'));
			} else {
				Message.warning(t('invite-call-exists'));
			}
			break;
		case '606':
			if (type === 'transfer') {
				Message.warning(t('multiple-call-exists-transfer'));
			} else {
				Message.warning(t('multiple-call-exists-invite'));
			}
			break;
		case '607':
			Message.warning(t('notAllow-transferIn-multiple'));
			break;
		default:
			Message.warning(t('transfer-timeout-wait-retry'));
			break;
	}
};
const backgroundImageRespone = (code: number) => {
	switch (code) {
		case Code.FILE_SIZE_ERROR:
			Message.info(t('background-size-error'));
			break;
		case Code.IMAGE_SIZE_ERROR:
			Message.info(t('image-size-error'));
			break;
		case Code.CREATE_BACKGROUND_COUNT_ERROR:
			Message.info(t('background-count-max'));
			break;
		case Code.FILE_TYPE_ERROR:
			Message.info(t('image-type-error'));
			break;
		case Code.CREATE_BACKGROUND_API_ERROR:
			Message.info(t('upload-failed'));
			break;
		default:
			break;
	}
};

const watermarkImageRespone = (code: number) => {
	switch (code) {
		case Code.FILE_SIZE_ERROR:
			Message.info(t('watermark-size-error'));
			break;
		case Code.IMAGE_SIZE_ERROR:
			Message.info(t('image-size-error'));
			break;
		case Code.CREATE_WATER_MARK_COUNT_ERROR:
			Message.info(t('watermark-count-max'));
			break;
		case Code.FILE_TYPE_ERROR:
			Message.info(t('image-type-error'));
			break;
		case Code.DELETE_WATER_MARK_ERROR:
			Message.info(t('delete-watermark-error'));
			break;
		case Code.CREATE_WATER_MARK_PARAMS_ERROR:
			Message.info(t('upload-failed'));
			break;
		default:
			break;
	}
};

const cancelInvitationsErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-invitation-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-invitation-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-invitation-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-invitation-failed'));
			break;
		default:
			break;
	}
};

const startTtsSpeakingErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-start-tts-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-start-tts-error'));
			break;
		case '5010':
			Message.warning(t('send-start-tts-failed'));
			break;
		case '5011':
			Message.warning(t('send-start-tts-failed'));
			break;
		default:
			break;
	}
};

const cancelTtsSpeakingErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-tts-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-tts-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-tts-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-tts-failed'));
			break;
		default:
			break;
	}
};

const screenshotErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-screenShot-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-screenShot-error'));
			break;
		case '5010':
			Message.warning(t('send-screenShot-failed'));
			break;
		case '5011':
			Message.warning(t('send-screenShot-failed'));
			break;
		default:
			break;
	}
};

const sendScannerCodeErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-scanCode-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-scanCode-error'));
			break;
		case '5010':
			Message.warning(t('send-scanCode-failed'));
			break;
		case '5011':
			Message.warning(t('send-scanCode-failed'));
			break;
		default:
			break;
	}
};

const cancelScannerCodeErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-scanCode-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-scanCode-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-scanCode-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-scanCode-failed'));
			break;
		default:
			break;
	}
};

const sendCustomerViewMarkCodeErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-customer-view-mark-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-customer-view-mark-error'));
			break;
		case '5010':
			Message.warning(t('send-customer-view-mark-failed'));
			break;
		case '5011':
			Message.warning(t('send-customer-view-mark-failed'));
			break;
		default:
			break;
	}
};

const cancelCustomerViewMarkErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-customer-view-mark-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-customer-view-mark-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-customer-view-mark-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-customer-view-mark-failed'));
			break;
		default:
			break;
	}
};

const requestGeolocationErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-get-location-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-get-location-error'));
			break;
		case '5010':
			Message.warning(t('send-get-location-failed'));
			break;
		case '5011':
			Message.warning(t('send-get-location-failed'));
			break;
		default:
			break;
	}
};

const cancelRequestLocationErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-get-location-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-get-location-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-get-location-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-get-location-failed'));
			break;
		default:
			break;
	}
};

const sendLinkErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-link-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-sendLink-error'));
			break;
		case '5010':
			Message.warning(t('send-link-failed'));
			break;
		case '5011':
			Message.warning(t('send-link-failed'));
			break;
		default:
			break;
	}
};

const sendVideoLinkErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-video-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-sendVideo-error'));
			break;
		case '5010':
			Message.warning(t('send-video-failed'));
			break;
		case '5011':
			Message.warning(t('send-video-failed'));
			break;
		default:
			break;
	}
};

const sendPDFErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-pdf-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-sendPdf-error'));
			break;
		case '5010':
			Message.warning(t('send-pdf-failed'));
			break;
		case '5011':
			Message.warning(t('send-pdf-failed'));
			break;
		default:
			break;
	}
};

const screenCaptureErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-screenCapture-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-screenCapture-error'));
			break;
		case '5010':
			Message.warning(t('send-screenCapture-failed'));
			break;
		case '5011':
			Message.warning(t('send-screenCapture-failed'));
			break;
		default:
			break;
	}
};

const requestHandSignErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-handSign-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-handSign-error'));
			break;
		case '5010':
			Message.warning(t('send-handSign-failed'));
			break;
		case '5011':
			Message.warning(t('send-handSign-failed'));
			break;
		default:
			break;
	}
};

const cancelHandWritingErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-handSign-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-handSign-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-handSign-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-handSign-failed'));
			break;
		default:
			break;
	}
};

const requestFillFormErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-fillForm-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-fillForm-error'));
			break;
		case '5010':
			Message.warning(t('send-fillForm-failed'));
			break;
		case '5011':
			Message.warning(t('send-fillForm-failed'));
			break;
		default:
			break;
	}
};

const cancelRequestFillFormErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-fillForm-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-fillForm-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-fillForm-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-fillForm-failed'));
			break;
		default:
			break;
	}
};

const cardCollectionErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-card-collect-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-card-collect-error'));
			break;
		case '5010':
			Message.warning(t('send-card-collect-failed'));
			break;
		case '5011':
			Message.warning(t('send-card-collect-failed'));
			break;
		default:
			break;
	}
};

const cancelCardCollectionErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-card-collect-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-card-collect-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-card-collect-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-card-collect-failed'));
			break;
		default:
			break;
	}
};

const startWhiteboardErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning('<开启白板>指令发送失败！');
			break;
		case '5009':
			Message.warning('断线重新连中，无法进行<开启白板>！');
			break;
		case '5010':
			Message.warning('<开启白板>指令发送失败！');
			break;
		case '5011':
			Message.warning('<开启白板>指令发送失败！');
			break;
		default:
			break;
	}
};

const deleteWhiteboardErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning('<删除白板>指令发送失败！');
			break;
		case '5009':
			Message.warning('断线重新连中，无法进行<删除白板>！');
			break;
		case '5010':
			Message.warning('<删除白板>指令发送失败！');
			break;
		case '5011':
			Message.warning('<删除白板>指令发送失败！');
			break;
		default:
			break;
	}
};

const sendWhiteBoardErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-whiteBoard-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-whiteBoard-error'));
			break;
		case '5010':
			Message.warning(t('send-whiteBoard-failed'));
			break;
		case '5011':
			Message.warning(t('send-whiteBoard-failed'));
			break;
		default:
			break;
	}
};

const cancelWhiteboardErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-whiteboard-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-whiteBoard-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-whiteboard-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-whiteboard-failed'));
			break;
		default:
			break;
	}
};

const sendTestimonyWriteErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-testimony-write-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-testimony-write-error'));
			break;
		case '5010':
			Message.warning(t('send-testimony-write-failed'));
			break;
		case '5011':
			Message.warning(t('send-testimony-write-failed'));
			break;
		default:
			break;
	}
};

const cancelTestimonyWriteErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-testimony-write-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-testimony-write-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-testimony-write-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-testimony-write-failed'));
			break;
		default:
			break;
	}
};

const sendPdfWhiteboardErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-pdf-whiteBoard-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-pdf-whiteBoard-error'));
			break;
		case '5010':
			Message.warning(t('send-pdf-whiteBoard-failed'));
			break;
		case '5011':
			Message.warning(t('send-pdf-whiteBoard-failed'));
			break;
		default:
			break;
	}
};

const cancelPdfWhiteboardErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-pdf-whiteBoard-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-pdf-whiteBoard-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-pdf-whiteBoard-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-pdf-whiteBoard-failed'));
			break;
		default:
			break;
	}
};

const sendCollectVariableErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-information-collect-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-information-collect-error'));
			break;
		case '5010':
			Message.warning(t('send-information-collect-failed'));
			break;
		case '5011':
			Message.warning(t('send-information-collect-failed'));
			break;
		default:
			break;
	}
};

const cancelCollectVariableErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-information-collect-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-information-collect-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-information-collect-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-information-collect-failed'));
			break;
		default:
			break;
	}
};

const collectShortVideoErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-collect-short-video-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-collect-short-video-error'));
			break;
		case '5010':
			Message.warning(t('send-collect-short-video-failed'));
			break;
		case '5011':
			Message.warning(t('send-collect-short-video-failed'));
			break;
		default:
			break;
	}
};

const cancelCollectShortVideoErrorResponse = (code: string | number) => {
	switch (code) {
		case '5006':
			Message.warning(t('send-cancel-collect-short-video-failed'));
			break;
		case '5009':
			Message.warning(t('reconnect-cancel-collect-short-video-error'));
			break;
		case '5010':
			Message.warning(t('send-cancel-collect-short-video-failed'));
			break;
		case '5011':
			Message.warning(t('send-cancel-collect-short-video-failed'));
			break;
		default:
			break;
	}
};

const requestUpgradeErrorResponse = (code: string | number, type: string) => {
	switch (code) {
		case '5006':
			Message.warning(type === 'video' ? t('request-upgrade-video-failed') : t('request-upgrade-audio-failed'));
			break;
		case '5009':
			Message.warning(type === 'video' ? t('reconnect-request-upgrade-video-error') : t('reconnect-request-upgrade-audio-error'));
			break;
		case '5010':
			Message.warning(type === 'video' ? t('request-upgrade-video-failed') : t('request-upgrade-audio-failed'));
			break;
		case '5011':
			Message.warning(type === 'video' ? t('request-upgrade-video-failed') : t('request-upgrade-audio-failed'));
			break;
		default:
			break;
	}
};

const cancelUpgradeErrorResponse = (code: string | number, type: string) => {
	switch (code) {
		case '5006':
			Message.warning(type === 'video' ? t('cancel-upgrade-video-failed') : t('cancel-upgrade-audio-failed'));
			break;
		case '5009':
			Message.warning(type === 'video' ? t('reconnect-cancel-upgrade-video-error') : t('reconnect-cancel-upgrade-audio-error'));
			break;
		case '5010':
			Message.warning(type === 'video' ? t('cancel-upgrade-video-failed') : t('cancel-upgrade-audio-failed'));
			break;
		case '5011':
			Message.warning(type === 'video' ? t('cancel-upgrade-video-failed') : t('cancel-upgrade-audio-failed'));
			break;
		default:
			break;
	}
};

const acceptUpgradeErrorResponse = (code: string | number, type: string) => {
	switch (code) {
		case '5006':
			Message.warning(type === 'video' ? t('accept-upgrade-video-failed') : t('accept-upgrade-audio-failed'));
			break;
		case '5009':
			Message.warning(type === 'video' ? t('reconnect-accept-upgrade-video-error') : t('reconnect-accept-upgrade-audio-error'));
			break;
		case '5010':
			Message.warning(type === 'video' ? t('accept-upgrade-video-failed') : t('accept-upgrade-audio-failed'));
			break;
		case '5011':
			Message.warning(type === 'video' ? t('accept-upgrade-video-failed') : t('accept-upgrade-audio-failed'));
			break;
		default:
			break;
	}
};

const rejectUpgradeErrorResponse = (code: string | number, type: string) => {
	switch (code) {
		case '5006':
			Message.warning(type === 'video' ? t('reject-upgrade-video-failed') : t('reject-upgrade-audio-failed'));
			break;
		case '5009':
			Message.warning(type === 'video' ? t('reconnect-reject-upgrade-video-failed') : t('reconnect-reject-upgrade-audio-failed'));
			break;
		case '5010':
			Message.warning(type === 'video' ? t('reject-upgrade-video-failed') : t('reject-upgrade-audio-failed'));
			break;
		case '5011':
			Message.warning(type === 'video' ? t('reject-upgrade-video-failed') : t('reject-upgrade-audio-failed'));
			break;
		default:
			break;
	}
};

const afterWorkEndErrorResponse = (code: string | number) => {
	switch (code) {
		case '3006':
			Message.warning(t('send-after-work-end-failed'));
			break;
		case '3007':
			Message.warning(t('send-after-work-end-failed'));
			break;
		case '3009':
			Message.warning(t('reconnect-after-work-end-error'));
			break;
		case '3008':
			Message.warning(t('send-after-work-end-failed'));
			break;
		default:
			break;
	}
};

export {
	initErrorResponse,
	loginErrorResponse,
	onDropErrorResponse,
	readyErrorResponse,
	unReadyErrorResponse,
	appointErrorResponse,
	checkInErrorResponse,
	checkOutErrorResponse,
	answerErrorResponse,
	ccsErrorResponse,
	ConnectStatusErrorResponse,
	systemErrorResponse,
	transferErrorResponse,
	backgroundImageRespone,
	watermarkImageRespone,
	cancelInvitationsErrorResponse,
	startTtsSpeakingErrorResponse,
	cancelTtsSpeakingErrorResponse,
	screenshotErrorResponse,
	sendScannerCodeErrorResponse,
	cancelScannerCodeErrorResponse,
	requestGeolocationErrorResponse,
	cancelRequestLocationErrorResponse,
	sendLinkErrorResponse,
	sendVideoLinkErrorResponse,
	sendPDFErrorResponse,
	screenCaptureErrorResponse,
	requestHandSignErrorResponse,
	cancelHandWritingErrorResponse,
	requestFillFormErrorResponse,
	cancelRequestFillFormErrorResponse,
	cardCollectionErrorResponse,
	cancelCardCollectionErrorResponse,
	startWhiteboardErrorResponse,
	deleteWhiteboardErrorResponse,
	sendWhiteBoardErrorResponse,
	cancelWhiteboardErrorResponse,
	sendTestimonyWriteErrorResponse,
	cancelTestimonyWriteErrorResponse,
	sendPdfWhiteboardErrorResponse,
	cancelPdfWhiteboardErrorResponse,
	sendCollectVariableErrorResponse,
	cancelCollectVariableErrorResponse,
	collectShortVideoErrorResponse,
	cancelCollectShortVideoErrorResponse,
	requestUpgradeErrorResponse,
	cancelUpgradeErrorResponse,
	acceptUpgradeErrorResponse,
	rejectUpgradeErrorResponse,
	afterWorkEndErrorResponse,
	sendCustomerViewMarkCodeErrorResponse,
	cancelCustomerViewMarkErrorResponse
};
